﻿@using Christ3D
@inject Christ3D.Domain.Interfaces.IUser SignInManager
@inject Microsoft.Extensions.Configuration.IConfiguration _configuration

@if (SignInManager.IsAuthenticated())
{
    if (_configuration["Authentication:IdentityServer4:Enabled"].ObjToBool())
    {
        <form asp-area="" asp-controller="Home" asp-action="Logout" method="post" id="logoutForm" class="navbar-right">
            <ul class="nav navbar-nav navbar-right">
                <li>
                    <a href="https://ids.neters.club/" title="Manage">Hello @SignInManager.Name!</a>
                </li>
                <li>
                    <button type="submit" class="btn btn-link navbar-btn navbar-link">Log out</button>
                </li>
            </ul>
        </form>
    }
    else
    {
        <form asp-area="" asp-controller="Account" asp-action="Logout" method="post" id="logoutForm" class="navbar-right">
            <ul class="nav navbar-nav navbar-right">
                <li>
                    <a asp-area="" asp-controller="Manage" asp-action="Index" title="Manage">Hello @SignInManager.Name!</a>
                </li>
                <li>
                    <button type="submit" class="btn btn-link navbar-btn navbar-link">Log out</button>
                </li>
            </ul>
        </form>
    }
}
else
{
    <ul class="nav navbar-nav navbar-right">
        <li><a asp-area="" asp-controller="Home" asp-action="Login">Log in</a></li>
    </ul>
}
